<extend name="Public/base"/>

<block name="body">
    <!-- 标题 -->
    <div class="main-title">
        <h2>
            <switch name="is_report" >
                <case value="2" >未报到学生人数</case>
                <case value="3">已报到学生人数</case>
                <default />全部学生人数
            </switch>
              ({$_total})
        </h2>
    </div>

    <!-- 按钮工具栏 -->
    <div class="cf">
        <div class="fl">
            <a class="btn" href="{:U('Reported')}">全部</a>
            <a class="btn" href="{:U('Reported',array('is_report'=>3))}">已报到</a>
            <a class="btn" href="{:U('Reported',array('is_report'=>2))}">未报到</a>
        </div>

        <!-- 高级搜索 -->
        <div class="search-form fr cf">
            <div class="btn-group-click adv-sch-pannel fl" style="margin-right: 10px;">
                <button class="btn">查询方式<i class="btn-arrowdown"></i></button>
                <div class="dropdown cf">
                    <div class="row" id="search_type">
                        <a href="javascript:" data-title="id" data-key="id">id</a>
                        <a href="javascript:" data-title="姓名" data-key="name">姓名</a>
                        <a href="javascript:" data-title="身份证号" data-key="ID_number">身份证</a>
                    </div>
                </div>
            </div>
            <div class="btn-group-click adv-sch-pannel fl">
                <a class="btn" href="{:U('exportStudentInfo',I('get.'))}">导 出</a>
            </div>
        </div>
    </div>


    <!-- 数据表格 -->
    <div class="data-table">
        <table class="">
            <thead>
            <tr>
                <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
                <th class="">编号</th>
                <th class="">姓名</th>
                <th class="">身份证号</th>
                <th class="">性别</th>
                <th class="">专业</th>
                <th class="">班级</th>
                <th class="">提交报到时间</th>
                <th class="">操作</th>
            </tr>
            </thead>
            <tbody>
            <notempty name="list">
                <volist name="list" id="vo">
                    <tr>
                        <td><input class="ids" type="checkbox" name="ids[]" value="{$vo.id}" /></td>
                        <td>{$vo.id} </td>
                        <td><span>{$vo['name']}</span></td>
                        <td><span>{$vo['ID_number']}</span></td>
                        <td><span><if condition="$vo['sex'] eq 0">男<else />女</if></span></td>
                        <td><?php $major=M('major')->where(array('id'=>$vo['major']))->field('title')->find(); echo $major['title']; ?></td>
                        <td><?php $class=M('class')->where(array('id'=>$vo['class_id']))->field('title')->find(); echo $class['title']; ?></td>
                        <td><span>{$vo.update_time|time_format}</span></td>
                        <td>
                            <switch name="vo.is_report">
                                <case value="1">
                                    <a class="confirm ajax-get" href="{:U('editInfo?is_report=3&id='.$vo['id'])}">已报到</a>
                                    <a class="confirm ajax-get" href="{:U('editInfo?is_report=2&id='.$vo['id'])}">未报到</a>
                                </case>
                                <case value="2">未报到</case>
                                <case value="3">已报到</case>
                            </switch>
                        </td>
                    </tr>
                </volist>
                <else/>
                <td colspan="11" class="text-center"> aOh! 暂时还没有信息! </td>
            </notempty>
            </tbody>
        </table>


    </div>

    <!-- 分页 -->
    <div class="page">
        {$_page}
    </div>
    </div>

</block>
<block name="script">
    <link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
    <php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
    <link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
    <script type="text/javascript" src="__STATIC__/layer/layer.js" charset="UTF-8"></script>
    <script type="text/javascript">
        $(function(){
            //搜索功能
            $("#search_type a").click(function(){
                var title='请输入'+$(this).attr('data-title'),
                    key=$(this).attr('data-key');
                layer.prompt({title: title, formType: 0}, function(value, index, elem){
                    var url='{:U("Student/Reported")}';
                    url += '?'+key+"="+value;
                    layer.close(index);
                    window.location.href = url;
                });
            })

            /* 状态搜索子菜单 */
            $(".search-form").find(".drop-down").hover(function(){
                $("#sub-sch-menu").removeClass("hidden");
            },function(){
                $("#sub-sch-menu").addClass("hidden");
            });
            $("#sub-sch-menu li").find("a").each(function(){
                $(this).click(function(){
                    var text = $(this).text();
                    $("#sch-sort-txt").text(text).attr("data",$(this).attr("value"));
                    $("#sub-sch-menu").addClass("hidden");
                })
            });

            //回车自动提交
            $('.search-form').find('input').keyup(function(event){
                if(event.keyCode===13){
                    $("#search").click();
                }
            });

            //导航高亮
            highlight_subnav('{:U("Student/Reported")}');

        })
    </script>
</block>
